package com.alex.tinyurl.conf;

import com.alex.tinyurl.service.genstrategy.DefaultTinyUrlGenerateStrategy;
import com.alex.tinyurl.service.genstrategy.TinyUrlGenerateStrategy;
import com.alex.tinyurl.service.store.UrlMappingStore;
import com.alex.tinyurl.service.store.db.DBUrlMappingStore;
import com.alex.tinyurl.service.store.db.dao.UrlMappingEntityDao;
import com.alex.tinyurl.service.store.mem.MemMapUrlMappingStore;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = {"com.alex.tinyurl.controller", "com.alex.tinyurl.service"})
@MapperScan(basePackages = {"com.alex.tinyurl.service.store.db.dao"})
public class Config {

    private final static Logger LOG = LoggerFactory.getLogger(Config.class);

    @Bean
    public TinyUrlGenerateStrategy tinyUrlGenerateStrategy() {
        return new DefaultTinyUrlGenerateStrategy();
    }

}
